package com.mls.fivedistrict.pojo;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author Five Team
 * @since 2018-06-14
 */
@Data
@Accessors(chain = true)
@TableName(value ="t_menu",resultMap = "BaseResultMap")
public class Menu extends Model<Menu> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 菜单名
     */
    @NotBlank(message = "菜单名不能为空")
    private String title;
    /**
     * 菜单对应的url
     */
    private String url;
    /**
     * 正常状态logo
     */
    private String normalLogo;
    /**
     * 选中log
     *
     */
    private String selectedLogo;
    private Date createDate;
    private String createBy;
    private Date updateDate;
    private String updateBy;
    private String orders;
    @TableLogic
    private Boolean isDelete;
    private Boolean isEnable;
    /**
     * 菜单唯一Code
     */
    private String code;

    /**
     * 父节点ID
     */
    private Long parentId;
    private transient  Menu parentMenu;
    /**
     * 子节点
     */
    private transient List<Menu> children;
    public Boolean getDelete() {
        return isDelete;
    }

    public void setDelete(Boolean delete) {
        isDelete = delete;
    }

    public Boolean getEnable() {
        return isEnable;
    }

    public void setEnable(Boolean enable) {
        isEnable = enable;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
